using Microsoft.UI.Xaml.Data;

namespace MultiAgentsClient.Converter;

public class ExpanderOrientationConverter : IValueConverter
{
    object IValueConverter.Convert(object value, Type targetType, object parameter, string language)
    {
        if (value is bool Expanded)
        {
            if (Expanded)
            {
                var expandedOrientation = new RotateTransform
                {
                    Angle = 90
                };
                return expandedOrientation;
            }
            else
            {
                var notExpandedOrientation = new RotateTransform
                {
                    Angle = 0
                };
                return notExpandedOrientation;
            }
        }

        throw new Exception("Should not happen.");
    }

    object IValueConverter.ConvertBack(object value, Type targetType, object parameter, string language)
    {
        throw new NotImplementedException();
    }
}
